#include <stdio.h>
#include <string>
#include <iostream>
#define NODE 1
#define LEAF 2
using namespace std;
int n1, n2;
bool debug= false;

typedef struct
{
    string name;
    int type, father;
}Ttree;    
Ttree tr[20000];
int ntr;

char * getNextString(char *p, string &tmps)
{
    char *end;
    if (*p=='/') p++; 
    end = p;
    while (*end != '/' && *end != 0 ) end++;
    tmps = string(p, end);
    // cout << tmps << endl;
    if (*end=='/') end++;
    return end;
}    
int search(const string &tmps, int fatherpos)
{
    int i;
    for (i=1; i<=ntr; ++i)
    {
        if (tr[i].name == tmps && tr[i].father == fatherpos) 
            return i;
    }    
    return -1;
}    

char ss[20000];


int getNode(char *ss)
{
    string tmps;
    int pos, fatherpos, mypos, i;
    char *p=ss;
    if (*p=='/') p++; 
    pos = 0;
    fatherpos = 0;
    while (*p)
    {
        p = getNextString(p, tmps);
        if (tmps==".")
        {
            if (tr[pos].type == LEAF) return -1;
            // do nothing
        }
        else if (tmps=="..")
        {
            if (tr[pos].type == LEAF) return -1;
            pos = tr[pos].father;
            if (pos==-1) return -1;
        }
        else // move point
        {       
            if (tr[pos].type == LEAF) return -1;
            pos = search(tmps, pos);
            if (pos == -1) return -1;
        }    
    }    
    
    if (tr[pos].type != LEAF || ss[strlen(ss)-1]=='/')
    {
        for (i=1; i<=ntr; ++i)
             if (tr[i].father == pos && tr[i].name=="index.html")
                  return i;
        return -1;
    }    
    else
    {
        return pos;
    }    
    
    
}    

void judge()
{
    int pos1, pos2;
    int i;
    for (i=0; i<n2; ++i)
    {
        scanf("%s", ss);
        pos1 = getNode(ss);
        scanf("%s", ss);
        pos2 = getNode(ss);
        if (debug)
        {
            printf("pos1=%d, pos2=%d\n", pos1, pos2);
        }    
        if (pos1 == -1 || pos2==-1 || tr[pos1].type==NODE || tr[pos2].type==NODE) printf("not found\n");
        else if (pos1==pos2) printf("yes\n");
        else printf("no\n");
    }        
}    

void buildTree()
{
    int i, fatherpos, mypos;
    char *p;
    string tmps;
    ntr = 0;
   
    for (i=0; i<n1; ++i)
    {
        scanf("%s", ss);
        fatherpos = 0;
        p = ss;
        while (*p)
        {
            p = getNextString(p, tmps);
            mypos = search(tmps, fatherpos);
            if (mypos == -1)
            {
                // add a node or leaf
                if (*p)
                {
                    ntr++;
                    tr[ntr].name = tmps;
                    tr[ntr].type = NODE;
                    tr[ntr].father = fatherpos;
                    fatherpos = ntr;
                }   
                else
                {
                    ntr++;
                    tr[ntr].name = tmps;
                    tr[ntr].type = LEAF;
                    tr[ntr].father = fatherpos;
                }     
            }    
            else 
            {
                // update the father node
                fatherpos = mypos;
            }    
        }    
    }    // end of for
}    
void outTree()
{
    int i;
    for (i=1; i<=ntr; ++i)
        printf("No.%d %s  type:%d father:%d\n", i, tr[i].name.c_str(), tr[i].type, tr[i].father);
}    

int main()
{
    tr[0].father = -1;
    while (scanf("%d%d",&n1, &n2)!=EOF)
    {
        if (n1==0 && n2==0) break;
        buildTree();
        if (debug) outTree();
        judge();
    }    
    
    return 0;    
}    

